#include <algorithm>
#include <cstdio>
#define N 410
#define INF 0x7fffffff
using namespace std;
int n, a[N], b[N], tot;
int f[N][N];
int main() {
	// freopen64("testdata.in", "r", stdin);
	// freopen64("testdata.out", "w", stdout);

	scanf("%d", &n);
	for (int i = 1; i <= n; ++i) {
		scanf("%d", &a[i]);
		tot+=a[i];
	}
	for (int i = 1; i <= n; ++i) {
		scanf("%d", &b[i]);
	}

	for (int i = 1; i <= n; ++i) {
		for (int l = 1; l <= n - i + 1; ++l) {
			int r = l + i - 1;
			f[l][r] = INF;
			for (int k = l; k <= r; ++k) {
				f[l][r] = min(f[l][r], f[l][k - 1] + f[k + 1][r] + b[l - 1] + b[r + 1]);
			}
		}
	}
	printf("%d", f[1][n] + tot);
	// fclose(stdin);
	// fclose(stdout);
	return 0;
}